/**
 * @file 时间选择器样式
 * @description 轨迹播放器时间范围选择和时间输入框相关样式
 */

/* 时间范围选择器 */
.time-range-selector {
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 32px;
  font-size: 12px;
  justify-content: center;
}

.time-input-group {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 100%;
  position: relative;
  z-index: 101;
}

.time-input-wrapper {
  position: relative;
}

.time-input {
  width: 85px;
  padding: 3px 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 12px;
  text-align: center;
  height: 28px;
  transition: all 0.2s ease;
  cursor: text;
  padding-right: 25px; /* 为时钟图标留出空间 */
  
  &:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.2);
    cursor: text;
    caret-color: #1890ff;
  }
  
  &::selection {
    background-color: rgba(24, 144, 255, 0.2);
  }
}

.time-clock-icon {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #666;
  pointer-events: none;
}

.time-dropdown {
  position: absolute;
  bottom: 100%; /* 改为从底部向上展开 */
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px; /* 改为底部边距 */
  background: white;
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15); /* 调整阴影方向 */
  display: flex;
  z-index: 100;
  width: 150px;
  max-height: 250px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.time-dropdown-column {
  flex: 1;
  overflow-y: auto;
  max-height: 250px;
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  /* 启用平滑滚动 */
  scroll-behavior: smooth;
  /* 确保滚动条可见 */
  scrollbar-width: thin;
  scrollbar-color: #1890ff #f0f0f0;
  background: #fff;
  
  &::-webkit-scrollbar {
    width: 6px;
  }
  
  &::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
  }
  
  &::-webkit-scrollbar-thumb {
    background: #1890ff;
    border-radius: 3px;
  }
  
  &:last-child {
    border-right: none;
  }
}

.time-dropdown-item {
  padding: 8px 0;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 14px;
  user-select: none;
  
  &:hover {
    background-color: #f0f8ff;
  }
  
  &.active {
    background-color: #1890ff;
    color: white;
    font-weight: 500;
  }
}

.time-separator {
  font-weight: bold;
  color: #666;
}

/* 开关样式 */
.range-toggle-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 5px;
  user-select: none;
  border-radius: 4px;
  
  &:hover {
    background-color: rgba(0,0,0,0.05);
  }
}

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 22px;
  margin-right: 8px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 34px;
  
  &:before {
    display: none; /* 禁用原来的伪元素，因为我们添加了一个实际的子元素 */
  }
}

.toggle-label {
  font-size: 14px;
} 